【Clojureでゼロから作るDeep Learning】 3章 ニューラルネットワーク
3.1 パーセプトロンからニューラルネットワークへ
3.1.1 ニューラルネットワークの例
3.1.2 パーセプトロンの復習
3.1.3 活性化関数の登場
3.2 活性化関数
3.2.1 シグモイド関数
3.2.2 ステップ関数の実装
code:clojure
user> (defn step-function x
(if (pos? x) 1 0))
#'user/step-function
user> (step-function 3.0)
1
user> (step-function 0)
0
user> (step-function -1.0)
0
user> (require 'clojure.core.matrix :as m)
nil
user> (m/set-current-implementation :clatrix)
:clatrix
user> (let [x (m/array -1.0 1.0 2.0)]
x)
(-1.0 1.0 2.0)
user> (let [x (m/array -1.0 1.0 2.0)]
(m/gt x 0))
(0.0 1.0 1.0)
user> (defn step-function x
(m/gt x 0))
#'user/step-function
user> (step-function (m/array 3.0 0 -1.0))
(1.0 0.0 0.0)
3.2.3 ステップ関数のグラフ
code:clojure:src/deep_learning_from_scratch/ch03/step_function.clj
(ns deep-learning-from-scratch.ch03.step-function
(:require clojure.core.matrix :as m
incanter.charts :as charts
incanter.core :as incanter))
(defn step-function x
(m/gt x 0))
(defn -main []
(m/set-current-implementation :clatrix)
(let [x (m/array (range -5.0 5.0 0.1))
y (step-function x)]
(doto (charts/xy-plot x y)
incanter/view)))
code:clojure
user> (refresh)
:reloading (deep-learning-from-scratch.ch03.step-function)
:ok
user> (deep-learning-from-scratch.ch03.step-function/-main)
#objectorg.jfree.chart.JFreeChart 0xf742771 "org.jfree.chart.JFreeChart@f742771"
https://gyazo.com/a80d5106a0d9d6f7d3a2a1be34f55378
3.2.4 シグモイド関数の実装
3.2.5 シグモイド関数とステップ関数の比較
3.2.6 非線形関数
3.2.7 ReLU関数
3.3 多次元配列の計算
3.3.1 多次元配列
3.3.2 行列の内積
3.3.3 ニューラルネットワークの内積
3.4 3層ニューラルネットワークの実装
3.4.1 記号の確認
3.4.2 各層における信号伝達の実装
3.4.3 実装のまとめ
3.5 出力層の設計
3.5.1 恒等関数とソフトマックス関数
3.5.2 ソフトマックス関数の実装上の注意
3.5.3 ソフトマックス関数の特徴
3.5.4 出力層のニューロンの数
3.6 手書き数字認識
3.6.1 MNISTデータセット
3.6.2 ニューラルネットワークの推論処理
3.6.3 バッチ処理
3.7 まとめ
#Clojureで『ゼロから作るDeep_Learning』学習メモ #Clojure